#include "Filter.h"
#include "CommandToken.h"
#include "RequestHeader.h"
#include "Service.h"

/* 处理请求与方法之间的映射 */
int handleMapping(int net_fd, RequestHeader *header, MYSQL *conn){
    if(header->command < 0 || header->command > 9){
        return 0;
    }
    switch (header->command){
        case LOGIN:
            return userLoginService(net_fd, header, conn);
            break;
        case REGISTER:
            return userRegisterService(net_fd, header, conn);
            break;
        case CD:
            break;
        case LS:
            break;      
        case PWD:
            return 1;
            break;
        case PUT_FILE:
            return userUploadFileService(net_fd, header, conn);
            break;
        case GET_FILE:
            return userDownloadFileService(net_fd, header, conn);
            break;
        case RM:
            return userDropFileOrDirectoryService(net_fd, header, conn);
            break;
        case MKDIR:
            break;
    }
    return 0;

}
